import request from '../utils/request.js';
//  获取 用户信息
export const getUserInfo = token => {
  return request({
    method: 'post',
    url: '/user/currentUser',
    headers: { Authorization: token },
  });
};

//  修改 用户信息
export const postUpdateUser = (
  token,
  autograph,
  avatar,
  email,
  mobilePhoneNumber,
  nickname,
) => {
  return request({
    method: 'post',
    url: '/user/updateUser',
    headers: {
      Authorization: token,
      'Content-Type': 'application/json',
    },
    data: {
      autograph: autograph,
      avatar: avatar,
      email: email,
      mobilePhoneNumber: mobilePhoneNumber,
      nickname: nickname,
    },
  });
};
